package com.example.logindb.controller;



import com.example.logindb.dto.ResponseMessage;
import com.example.logindb.entity.Location;
import com.example.logindb.sevices.LocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//错了，看其他controller
@RestController
@RequestMapping("/route")
public class RouteController {
    @Autowired
    LocationService locationService;

    //更新在线位置
    @PostMapping
    public ResponseMessage<Location> updateStatus(@RequestBody Location location)
    {
        locationService.updateLocation(location);
        return ResponseMessage.success(location);
    }

//    //查询在线位置
//    @GetMapping("/{id}")
//    public ResponseMessage<Location> get_relation(@PathVariable Integer id)
//    {
//        return ResponseMessage.success(locationService.findAllById(id));
//    }

}
